package com.usian.feign;

import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 韩耀东
 * @date 2021/1/8 8:23
 */
@FeignClient("usian-content-service")
public interface CotnentServiceFeign {
    /**
     * @return java.util.List<com.usian.pojo.TbContentCategory>
     * @Author 韩耀东
     * @Description //TODO 根据父节点 ID 查询子节点
     * @Date 2021/1/8 8:46
     * @Param [parentId]
     **/
    @RequestMapping("/contentCategory/selectContentCategoryByParentId")
    List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Long parentId);

    @PostMapping("/contentCategory/insertContentCategory")
    Integer insertContentCategory(TbContentCategory tbContentCategory);

    @DeleteMapping("/contentCategory/deleteContentCategoryById")
    Integer deleteContentCategoryById(@RequestParam Long categoryId);

    @RequestMapping("/contentCategory/updateContentCategory")
    Integer updateContentCategory(@RequestParam Long id,
                                  @RequestParam String name);

    @RequestMapping("/content/selectTbContentAllByCategoryId")
    PageResult selectTbContentAllByCategoryId(@RequestParam Integer page,
                                              @RequestParam Integer rows,
                                              @RequestParam Long categoryId);

    @RequestMapping("/content/insertTbContent")
    Integer insertTbContent(TbContent tbContent);

    @RequestMapping("/content/deleteContentByIds")
    Integer deleteContentByIds(@RequestParam Long ids);

    @RequestMapping("/content/selectFrontendContentByAD")
    List<AdNode> selectFrontendContentByAD();
}
